home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / hptex / hptex.doc < prev    next >
Text File  |  1992-08-26  |  36KB  |  752 lines

  1. This is the documentation for HP TeX, version A.00.00, Feb. 14, 1984.
  2.                    Copyright 1984 Hewlett-Packard Co.
  3.  
  4. NOTE   1: Plain is read in as a separate file.
  5.  
  6. NOTE   2: "@" temporarily becomes a letter so that HP TeX can use the
  7.           internal control sequences of PLAIN, and to avoid conflict between
  8.           the internal control sequences of HP TeX and user names.
  9.  
  10. NOTE   3: This defines leaders used in the table of contents macros.
  11.  
  12. <<FONTS>>
  13.  
  14. NOTE   4: HP TeX has fonts available in sizes from 5 points to 24 points. The
  15.           fonts loaded in Plain are listed as comments to make it easier to
  16.           verify the fonts available.
  17.  
  18. NOTE   5: In case a font is used in a write or message.
  19.  
  20. NOTE   6: \fontdef#1#2 defines the control sequence for the font, but the
  21.           font is not loaded until the first time the control sequence is
  22.           actually used. The first parameter is the control sequence to be
  23.           defined; the second is the external font name.
  24.  
  25. <<MACROS TO SET FSTYLE>>
  26.  
  27. NOTE   7: These macros set the family and the background style.  Then using
  28.           \setfont they set the current font.
  29.  
  30. <<MACROS TO SET FSIZE>>
  31.  
  32. NOTE   8: These macros set the background font size, and then use \setfont to
  33.           set the current font.  \baselineskip and \strutbox are set to
  34.           values appropriate to the font size.  The fonts in families 0, 1,
  35.           and 2 are changed to appropriate sizes.  The fonts that are not
  36.           already loaded, are not loaded unless they are needed by an entry
  37.           into either math mode or display mode.
  38.  
  39. <<MACROS TO SET CURRENT FONT USING FSTYLE AND FSIZE>>
  40.  
  41. NOTE   9: \tryfont#1 sets \nofont@ to true if the control sequence determined
  42.           by the current background font size and style (#1) has not yet been
  43.           defined.  If the control sequence does exist, \nofont@ is set to
  44.           false, and the control sequence is invoked.
  45.  
  46. NOTE  10: \setfont uses \tryfont to set the current font based on the
  47.           background font size and style.  If there is no control sequence
  48.           defined for that font, then \tryfont is used again to check for a
  49.           font with the background size and in roman style.  If there is
  50.           still no control sequence defined for that font, the size ten and
  51.           style roman is tried.  This will always succeed in HP TeX.
  52.  
  53.           \ffam will be a third factor in determining the current font when
  54.           other font families become available.
  55.  
  56. <<DEFAULTS>>
  57.  
  58. NOTE  11: The default values in HP TeX are family0 and font \tenrm with a
  59.           background style of roman, a background size of ten points, and a
  60.           superscript/subscript size of seven points.
  61.  
  62. <<LINE MACROS>>
  63.  
  64. NOTE  12: These line setting macros take \leftskip and \rightskip into
  65.           account.
  66.  
  67. <<MORE MACROS>>
  68.  
  69. NOTE  13: This replaces Knuth's definition of \narrower.  \narrow@ is used in
  70.           the note and warning macros.
  71.  
  72. NOTE  14: \need is followed by a dimension x.  It uses \need@ to determine
  73.           if x space remains on the page, and if not, causes an eject to
  74.           the next page.
  75.  
  76.           \need@ depends on \okbreak which merely encourages a page break
  77.           at that point.  Its effect is dependent on its nearness to the
  78.           bottom of the page, and whether the text following the \need
  79.           fits completely on the page or not.
  80.  
  81. NOTE  15: \for provides a for-loop.  Parameter #1 (\fcount@) contains the
  82.           variable name; #2 is the initial value of the variable; #3
  83.           (\fexit@) is the terminating value; #4 (\floop@) contains the
  84.           instructions to be done in the loop. The loop will not execute
  85.           unless the initial value (#2) is less than or equal to the
  86.           terminating value (#3). \next@ is set to \fnext@.
  87.  
  88. NOTE  16: \fnext@ provides the looping capability for \for. It executes
  89.           \floop@ and then checks to see if \fcount@ has reached the
  90.           terminating value.  If it hasn't, then \fcount@ is incremented.  If
  91.           the terminating value has been reached, \next@ is set to \relax.
  92.           \next@ is then entered and depending on its current meaning, either
  93.           the loop is repeated via \fnext@, or \relax ends the looping.
  94.  
  95.  
  96. NOTE  17: \uline#1 makes an \vbox containing #1 with a horizontal rule .23em
  97.           under its baseline, and then creates an \hbox containing the vbox
  98.           lowered by the amount necessary to place the baseline of #1 in line
  99.           with the baseline of the current line of text.
  100.  
  101. <<START AND FINISH GROUP STRUCTURE>>
  102.  
  103. NOTE  18: \start#1 and \finish#1 define local nestable blocks.  In the
  104.           event of any error, the error message is delayed until corrections
  105.           are complete.
  106.  
  107. NOTE  19: \start#1 uses \ifinvalid@ to determine if #1 is a valid
  108.           blockname. If it is, a block (group) is begun and  \blockname@
  109.           stores #1 as the current block. The control sequence \BEGIN#1 is
  110.           invoked and \Error is called to print out any error messages.
  111.  
  112. NOTE  20: \finish#1 calls \ifinvalid@ to determine if #1 is a valid
  113.           blockname. If it is valid, \matchup@ is called to close block #1.
  114.           \Error is called to print out any error messages.
  115.  
  116. NOTE  21: \ifinvalid@#1 tests to see if the control sequence \BEGIN#1
  117.           has been defined.  If it has not been defined, it is ignored
  118.           and \errset is called to store an error message.
  119.  
  120. NOTE  22: \matchup@#1 closes blocks as follows: if a \finish is used when no
  121.           block currently exists, it is ignored. if a finish does not match
  122.           the current blockname, blocks are closed until either a match is
  123.           found or all blocks are closed.  The parameter is the parameter to
  124.           \finish.
  125.  
  126. NOTE  23: \done closes the current block.
  127.  
  128. <<GENERAL ERROR HANDLING>>
  129.  
  130. NOTE  24: These macros are used for general purpose error handling.
  131.           \errfalse clears the error status. \errset assumes an argument of
  132.           an error message; any use of \errset sets the error status and
  133.           produces an error message when \Error is encountered.
  134.  
  135. <<DATE AND TIME MACROS>>
  136.  
  137. NOTE  25: \mon sets the current month with the current font.
  138.  
  139. NOTE  26: \date sets the current date: <month> <day>, <year>.
  140.  
  141. NOTE  27: \hour sets the current time of day in 12 hour format:
  142.           <hour>:<minutes> <AM or PM>.
  143.  
  144. <<INDENTSTYLE>>
  145.  
  146. NOTE  28: The switch \ifindent acts as a flag to indicate when \indentstyle
  147.           is being used.  This is used in \indentstyle, \noindentstyle, and
  148.           \indentspace.
  149.  
  150. NOTE  29: \indentstyle sets \parindent to \indentsize. If \indentstyle is
  151.           already in effect, \parskip is not changed. If \indentstyle is
  152.           not already in effect, \parskip is decreased by 5 points.
  153.  
  154. NOTE  30: \noindentstyle sets \parindent to zero points.  If \indentstyle is
  155.           in effect, \parskip is increased by 5 points, otherwise it is not
  156.           changed.
  157.  
  158. NOTE  31: \indentspace will update \parindent only if \indentstyle is in
  159.           effect.
  160.  
  161. <<RAGGED MARGIN>
  162.  
  163. NOTE  32: \fixmargin@ preserves the original \rightskip.
  164.  
  165. NOTE  33: \justify undoes the effects of \raggedright by returning to the
  166.           original \rightskip, and resetting the interword and intersentence
  167.           space to the default values.
  168.  
  169. NOTE  34: \raggedright saves the original \rightskip with \fixmargin@, adds
  170.           some stretch to \rightskip, and if \tt is not in effect, fixes the
  171.           interword and intersentence spaces.
  172.  
  173. NOTE  35: \tt@ is used in \raggedright in the \ifx comparison.  It is
  174.           necessary if the comparison is to succeed.
  175.  
  176. <<ITEM AND SUBITEM>>
  177.  
  178. NOTE  36: \itemset@ takes three parameters: #1 specifies the left indentation
  179.           (in multiples of \inset), #2 should be the sum of the left and
  180.           right indentation (in multiples of \inset) , and #3 is the tag to be
  181.           hung to the left of the item.  The line size is in \dimen@. \parshape
  182.           is used to build the paragraph.  The tag (#3) is hung to the left of
  183.           the paragraph.
  184.  
  185. NOTE  37: \itemlist#1 is syntactically the same as \item, however \itemlist
  186.           preserves \leftskip and \rightskip, and  both the left and
  187.           right margins are indented by the value of \inset. The parameter
  188.           contains the tag for the item.  Each time \itemlist is used,
  189.           the subitem tag is reset, and the item tag is incremented if
  190.           appropriate.
  191.  
  192. NOTE  38: \subitem#1 is syntactically the same as \itemitem, however left and
  193.           rightskip are preserved, and both the left and right margins are
  194.           indented by twice the value of \inset. The parameter contains the
  195.           tag for the subitem. Each time \subitem is used, the subitem tag
  196.           is incremented, if appropriate.
  197.  
  198. NOTE  39: \itempar creates a paragraph identical to that created by \itemlist
  199.           except it will have an empty tag.  It can be used for the second
  200.           paragraph of an item.
  201.  
  202. NOTE  40: \subitempar creates a paragraph like that created by \subitem, but
  203.           with an empty tag.
  204.  
  205.  
  206. <<ITEM TAG AND SUBITEM TAG MACROS>>
  207.  
  208. NOTE  41: The definition of a tag must do three things:
  209.               1. define a control sequence \reset[sub]items which will be
  210.                  used to restart tag allocation between lists;
  211.               2. restart tag allocation;
  212.               3. define a control sequence \[sub]itemtag to produce a tag.
  213.  
  214.           \icount@ (\scount@) holds the value used to determine the current
  215.           item (subitem) tag for numbered and lettered tags.
  216.  
  217.           \idigit@ (\sdigit@) is used with lettered tags to keep track of how
  218.           many times the item (subitem) tags have gone through the alphabet
  219.           without being reset.
  220.  
  221. NOTE  42: \itemn@#1 is used in the allocation of numbered tags. The parameter
  222.           is either \icount@ or \scount@.
  223.  
  224. NOTE  43: \itemr@#1 is used in the allocation of lower case Roman tags. The
  225.           parameter is either \icount@ or \scount@.
  226.  
  227. NOTE  44: \itemR@#1 is used in the allocation of upper case Roman tags.
  228.           The parameter is either \icount@ or \scount@.
  229.  
  230. NOTE  45: \iteml@#1#2 is used in the allocation of lettered tags. If the
  231.           end of the alphabet is reached, it begins again with "aa" or
  232.           "AA".  The first parameter is either \icount@ or \scount@.  The
  233.           second parameter is either \idigit@ or \sdigit@.
  234.  
  235. NOTE  46: \item@#1,#2,#3 takes three parameters: #1 is the initial value of
  236.           \icount@ (item counter), #2 is the value of \idigit@ which  is
  237.           used to print out the appropriate number of letters when using
  238.           letters as tags, and #3 is the definition of the \itemtag.  It
  239.           defines \resetitems to be the initialization of \icount@ and
  240.           \idigit@.
  241.  
  242. NOTE  47: \itm does not take a parameter.  It uses the current \itemtag
  243.           as the parameter to \itemlist.  If the \itemtag is numbers or
  244.           letters, a period is appended to the tag.
  245.  
  246. NOTE  48: \subitem@ is similar to \item@.
  247.  
  248. NOTE  49: \sitm is the subitem macro equivalent to \itm for item.
  249.  
  250. NOTE  50: The defaults are \numbereditems and \letteredsubitems.The
  251.           execution of these macros defines \itemtag, \subitemtag,
  252.           \resetitems, and \resetsubitems.
  253.  
  254. <<NOTE AND WARNING MACROS>>
  255.  
  256. NOTE  51: \BEGINnote defines the blockname "note" and sets the indentation
  257.           at twice the left and right skip amounts.
  258.  
  259. NOTE  52: \BEGINwarning defines the blockname "warning," sets the indentation
  260.           to twice the left and rightskip amounts, and places a horizontal
  261.           rule above the text.  \ENDwarning places a horizontal rule below
  262.           the text.
  263.  
  264. NOTE  53: \marginrule#1 defines an \hrule limited by \leftskip and
  265.           \rightskip.  Its only parameter specifies the height of the rule.
  266.  
  267. <<VERBATIM MODE>>
  268.  
  269. NOTE  54: In verbatim mode, all characters except (\), ({) and (}) are treated
  270.           verbatim. Characters that cannot be extracted from the current font
  271.           are taken from the math font and given a fixed space equal to the
  272.           space of the current font.
  273.  
  274.  
  275. <<LUMPLINE AND LUMPSPACE MACROS>>
  276.  
  277. NOTE  55: These macros make the verbatim mode use less memory. Multiple lines
  278.           and spaces are lumped together to make one large glob of glue
  279.           rather than many small globs.
  280.  
  281.           The carriage return is made into an active character, and given
  282.           the meaning of \lumpline@. \lumpline@ accumulates sequential
  283.           carriage returns into one lump of vertical glue in \skip@.
  284.  
  285.           '\ ' is made into an active character, and given the meaning of
  286.           \lumpspace@.  \lumpspace@ accumulates sequential spaces into
  287.           one lump of horizontal glue in \skip@.
  288.  
  289. <<PAGE CONTROL MACROS>>
  290.  
  291. NOTE  56: \newpage first balances multi-column format which transfers the
  292.           contents of \box 255 to \contrib@, so it always looks like the
  293.           page is empty immediately afterwards. The box \contrb@ is checked
  294.           to see if the page is really empty.
  295.  
  296.           If \newpage occurs at the bottom of a full page, the \null\vfill
  297.           remains in recent contributions  and causes an extra page to be
  298.           ejected.  The workaround is to insert an \eject in the document
  299.           just before the \newpage (or the macro containing the \newpage).
  300.  
  301.           The same problem occurs with \evenpage and \oddpage, and
  302.           the same workaround is effective.
  303.  
  304. <<HEADING AND FOOTING MACROS>>
  305.  
  306. NOTE  57: Headlines and footlines are constructed as follows:
  307.  
  308.           (1) under normal conditions the centered heading or footing is
  309.           centered, but in the event that one (or more) of the headings or
  310.           footings are too wide, space is distributed if possible so there is
  311.           no overlap. The macro triplehead@ does this.
  312.  
  313.           (2) inside and outside headings and footings have priority over
  314.           left and right headings and footings.  \buildline takes care of
  315.           this.
  316.  
  317.           Notice that if the tokens in an \hbox have width 0pt, it is
  318.           assumed they are empty.
  319.  
  320.           The macros and token registers associated with headings and
  321.           footings should be used near forced page breaks or at the begining
  322.           of the document. TeX scans ahead when building a page, so the use
  323.           of these macros could affect the previous page.
  324.  
  325. NOTE  58: \buildline decides which tokens will be on the left and right of
  326.           the headline or footline that is being constructed.  \lft and \rght
  327.           hold the numbers of the boxes containing the tokens to be placed on
  328.           the left and right sides of the line. They are initialized to the
  329.           boxes for \leftheading and \rightheading. If the box containing the
  330.           \insideheading (\box3) is not empty, then for an odd page \lft is
  331.           set to 3, and for an even page \rght is set to 3.
  332.  
  333.           If the box containing the \outsideheading (\box4) is not empty,
  334.           then for an odd page \rght is set to 4, and for an even page \lft
  335.           is set to 4.
  336.  
  337.           \triplehead is called to actually construct the line.
  338.  
  339. NOTE  59: \triplehead#1#2#3 requires three parameters. #1 is the number of
  340.           the box that is to go to the left, #2 is the box number for the
  341.           center, and #3 is the box number for the right.  \skip@ is the glue
  342.           to go between the left and center boxes, and \skip@ii is the glue
  343.           to go between the center and right boxes.
  344.  
  345.           If the width of the left box is greater than the width of the right
  346.           box, \skip@ii is increased by the difference, otherwise, \skip@ is
  347.           increased by the difference.
  348.  
  349.           The line is then built by stringing together the boxes and glue.
  350.  
  351. NOTE  60: \loadbox#1#2 takes two parameters: #1 is the box number, #2 is the
  352.           token list to be put in the box.
  353.  
  354. NOTE  61: \headline checks to see if headings are turned on or off.  If on,
  355.           it loads the appropriate boxes with the various heading token
  356.           lists and calls \buildline. If off, it adds horizontal glue, and
  357.           if \suspendheading is in effect, updates the \headcount.
  358.  
  359. NOTE  62:  \footline is similar to \headline.
  360.  
  361. <<BOX MACROS>>
  362.  
  363. NOTE  63: \boxit#1 takes as its parameter the text to be placed in the box,
  364.           and can be used when a real box is wanted, e.g., \setbox0\boxit{...}.
  365.           \boxit uses \halign to center the lines of text, separated by \cr,
  366.           within the box.
  367.  
  368.           The value of \boxline determines the thickness of the rule around
  369.           the box.  The value of \boxspace determines the amount of space
  370.           between the rule and the text.
  371.  
  372. NOTE  64: \centerbox#1 takes as its parameter the text to be boxed, and then
  373.           uses \centerline to center the box resulting from \boxit#1. The box
  374.           is separated from surrounding text by \abovedisplayskip and
  375.           \belowdisplayskip.
  376.  
  377. NOTE  65: \textbox#1 takes as its parameter the text to be boxed.  It places
  378.           the boxed text in the current line (or begins a new paragraph if
  379.           encountered in vertical mode) with the baseline of the enclosed
  380.           text lined up with the baseline of the line.
  381.  
  382. <<HP2680A and HP2688A COPY CONTROL MACROS>>
  383.  
  384. NOTE  66: These commands control the number of copies per page.  Owing to the
  385.           synchronization problems associated with TeX, these should only be
  386.           used near forced page ejects or at the begining of a document.
  387.  
  388.           \globalspecial writes the parameter to the postamble of the
  389.           PIF file.
  390.  
  391.           \copycnt contains the number of the register that the PIF server
  392.           will look in to find the number of copies desired.
  393.  
  394.           \oldcopy contains the number of copies desired.  The default is
  395.           two, so if \copieson is invoked before the user has used \copies<n>,
  396.           two copies will be generated.
  397.  
  398. <<HP2680A and HP2688A LOGICAL PAGE CONTROL (LPC) MACROS>>
  399.  
  400. NOTE  67: \lpcount@ holds the number of the register to be interpreted
  401.           by the PIF driver for explicit logical page control.
  402.  
  403.           \nextlp@ holds the page control number to be put into
  404.           \count\lpcount@.
  405.  
  406.           These macros avoid the synchronization problems of TeX by
  407.           interjecting a page eject at an appropriate time.  At the beginning
  408.           of the document and after each \shipout, the "empty@" flag is set
  409.           to true.
  410.  
  411.           If an LPC macro occurs when the "empty@" flag is true, \nextlp@
  412.           is updated, its value is put into \count\lpcount@, and the flag
  413.           is set to false.
  414.  
  415.           If an LPC macro occurs when the "empty@" flag is false, \nextlp@
  416.           is updated, but the value in \count\lpcount@ is not changed. After
  417.           the next shipout, \count\lpcount@ is updated by the output routine.
  418.  
  419.           The codes for \lpreset and \lpexit will, if left alone, only endure
  420.           for one page.
  421.  
  422. <<TABLE MACROS>>
  423.  
  424. NOTE  68: The table macros are complex.  It is recommended that anyone
  425.           wanting to understand how they work examine the LOG file of
  426.           a small table created with \tracingmacros=1 and \tracingcommands=2.
  427.  
  428.           The table macros use unallocated dimension and token registers to
  429.           store the column specifications.  New dimensions or tokens should
  430.           not be allocated between the \tableformat and the last \tablerow or
  431.           \tablebar in a table.  If any are allocated the result will be a
  432.           very strange looking table and a TeX error.  If too many columns,
  433.           dimensions, tokens or inserts are allocated, an error message is
  434.           given and the registers are used anyway.
  435.  
  436.           A row is processed in sections.  \parseline@ takes sections of the
  437.           parameter to \tableformat or \tablerow.  Each section is delimited
  438.           by a ~.  \parsecol@ takes sub-sections of the section where each sub-
  439.           section is delimited by a |.  After a sub-section is processed, the
  440.           next sub-section is fetched until the end of a section is reached.
  441.           The next section is then fetched and processed until the end of the
  442.           original parameter to \tableformat or \tablerow is reached.
  443.  
  444.           \span is temporarily redefined during the execution of either a
  445.           \tablerow or \tablebar macro to allow spanning of multiple columns.
  446.  
  447.           The standard table specifications are \leftline, \rightline,
  448.           \centerline and (for internal columns) \paragraph. You can also
  449.           make your own. There are only two rules:
  450.             (1) your macro will have one parameter (the text)
  451.             (2) your macro will yield a box of width \hsize.
  452.  
  453.  
  454. NOTE  69: \uptoks@ increments \cntA@, used as a pointer to a token register
  455.           to hold column alignment specifications, and \cntB@, used as a
  456.           pointer to a dimension register used to hold column width specifi-
  457.           cations. If too many token registers are used, an error message is
  458.           printed, and processing continues.
  459.  
  460. NOTE  70: \bump@ increments \cntC@, which contains the number of columns
  461.           processed in the current \tablerow or \tablebar. If the total number
  462.           of columns specified in the \tableformat has not yet been processed,
  463.           then \cntC@ is incremented, and \uptoks@ is called to increment the
  464.           pointers to the registers that hold the column specifications.
  465.  
  466.           NOTE 71: \tableformat#1 has as its parameter the description of the
  467.           table format.  The alignment for the entire table is given first,
  468.           followed by the formats for each column.  A column format consists
  469.           of its alignment followed by its width.  A | separates the table
  470.           format from the column formats, and each column format from the
  471.           next.
  472.  
  473.           \tableformat first calls \tablelet with the three parameters
  474.           \just@, \just@, and \relax.
  475.  
  476.           Next, \parse@ (which has been assigned the meaning of \parseline@)
  477.           is called and sent one parameter, which is delimited by ~.  This
  478.           effectively sends the contents of the parameter of \tableformat up
  479.           to the first ~ to \parse@ (\parseline@). The \done@ is an undefined
  480.           control sequence used to mark the end of the specifications in the
  481.           \tableformat.
  482.  
  483. NOTE  72: \tablerow#1 is similar to \tableformat.  Its parameter is a list of
  484.           the contents for each column of the row.  Each column must start
  485.           and terminate with either a | for a visible bar, or a ~ for an
  486.           invisible bar.
  487.  
  488.           The parameters sent to \tablelet are: \bbar@, \wbar@, and \endrow@.
  489.  
  490. NOTE  73: \tablebar#1 sets horizontal rules across the table.  It resets
  491.           \topstrut, \botstrut, and \tablespace, and then passes its
  492.           parameter to \tablerow.  Its parameter is a list of column
  493.           contents, with each column indicated as for \tablerow.  A
  494.           column can be empty, contain a \vrule, or contain \tbar.
  495.  
  496. NOTE  74: \tablelet requires three parameters.  The first is assigned to the
  497.           control sequence \b@, the second to \w@, and the third to \f@.
  498.           \CntA@, \CntB@, and \CntC@ are initialized.  \parse@ is assigned
  499.           the meaning of \parseline@. If currently in horizontal mode,
  500.           vertical mode is entered; if in vertical mode, interline glue is
  501.           inhibited.
  502.  
  503. NOTE  75: \just@#1 is never invoked directly.   The control sequences \b@
  504.           and \w@ are \let to be \just@ in \tablelet when \tablelet is
  505.           called from \tableformat.  \just@ is invoked by \parsecol@ the
  506.           first time \parsecol@ is entered. The parameter to \just@ is the
  507.           alignment specification for the table.
  508.  
  509.           \just@ assigns the control sequences \b@ and \w@ the meaning of
  510.           \tform@, and initializes \maxcol@ to 0.  The control sequence
  511.           \tablejust@ is assigned the table alignment specification (#1).
  512.  
  513. NOTE  76: \tform@#1 passes its parameter, which is the set of specifications
  514.           for a column, on to \tform@@ with a ~ deliminating the parameter.
  515.  
  516. NOTE  77: \tform@@#1#2~ updates the pointers to the registers to be used
  517.           for storing column specifications, puts the column alignment (#1)
  518.           into the current token register, and the column width (#2) into the
  519.           current dimension register.  Then \maxcol@ is incremented to count
  520.           the column just completed.
  521.  
  522. NOTE  78: \bbar@#1 begins a row that starts with a visible vrule.  The
  523.           parameter is empty.
  524.  
  525. NOTE  79: \wbar@#1 begins a row that starts with an invisible vrule.  The
  526.           parameter is empty.
  527.  
  528. NOTE  80: \beginrow@#1 reassigns \b@ and \w@ the meanings of \vbar@ and
  529.           \ibar@ respectively. The parameter is empty.
  530.  
  531.           Box0, an \hbox that will contain the row, is begun with a \bgroup,
  532.           and the assignments that should hold within the box are made.
  533.  
  534. NOTE  81: \endrow@ finishes Box 0 and aligns the resulting box according to
  535.           \tablejust@.
  536.  
  537. NOTE  82: \vbar@#1 adds a column entry that terminates with a visible \vrule.
  538.           The parameter contains the column entry.
  539.  
  540. NOTE  83: \ibar@#1 adds a column entry that terminates with an invisible
  541.           \rule. The parameter contains the column entry.
  542.  
  543. NOTE  84: \cs@#1 determines if a column entry (#1) spans multiple columns,
  544.           and invokes \span@ with the appropriate parameters.
  545.  
  546. NOTE  85: \parseline@#1~ is called by \tableformat and \tablerow (and
  547.           indirectly by \tablebar).  Its parameter is the part (section) of
  548.           the parameter to the calling macro terminated by the first
  549.           occurrence of ~ .  If the parameter is \done@, then processing is
  550.           complete, and \parse@ is assigned the current meaning of \f@, which
  551.           is \relax if \parseline@ was called from \tableformat, or \endrow@
  552.           if \parseline@ was called from \tablerow.
  553.  
  554.           If processing is not done, \p@ss is assigned the meaning of
  555.           \parsecol@, and then \p@ss is invoked and its parameter is
  556.           that part (sub-section) of the parameter to \parseline@ up to the
  557.           first occurrence of |. \done@ is an end of processing indicator.
  558.           \parse@ is invoked and, depending on its current assigned meaning,
  559.           either terminates processing of this \tableformat or \tablerow
  560.           parameter, or takes the next section of the parameter of the
  561.           \tableformat or \tablerow terminated by ~ as its parameter.
  562.  
  563. NOTE  86: \parsecol@#1 is called by \parseline@ and has as its parameter that
  564.           part (sub-section) of the parameter to \parseline@ up to the next
  565.           occurrence of |.  It defines the macro \parsemode@: if we are on
  566.           the last column, then the currently assigned value of \w@ (\tform@
  567.           or \ibar@, depending on whether a \tableformat or a \tablerow is
  568.           being processed) is invoked, and \p@ss becomes \lastp@ss; if we are
  569.           not on the last column, then \b@ (which is either \tform@ or
  570.           \vbar@) is invoked; in either case, \p@ss is called again and will
  571.           either terminate processing or get the next section to be
  572.           processed.
  573.  
  574.  
  575. NOTE  87: \span@#1#2 sets a box spanning the required number of columns and
  576.           containing the text in the parameter.  \hsize and \z@ are set to
  577.           the width and alignment specifications respectively of the first
  578.           column spanned.  The pointers are then incremented once for each
  579.           column spanned, and the width of each column plus the width of a
  580.           vertical bar is added to the \hsize for each column spanned. The
  581.           first parameter is the integer following \span, and the second is
  582.           the remainder of the column contents.
  583.  
  584. <<SECTION AND HEADING MACROS>>
  585.  
  586. NOTE  88: These macros are used for head or section level control.
  587.  
  588.           \basehead is the zero pointer value for the four pointers
  589.           to the head counters. The head counters count the number of
  590.           current headings at each heading level.
  591.  
  592.           \headlevel keeps track of the level of the current heading.
  593.  
  594.           To add a fifth level, do the following:
  595.              (1) Change the "\advance\count10by4" command to
  596.                  "\advance\count10by5".  This allocates
  597.                  the counters for the level number.
  598.  
  599.              (2) Change "\ifnum\hdlevel<4 " to "\ifnum\hdlevel<5
  600.                  in the \sethead@ macro.
  601.  
  602.              (3) Allocate a new token register, \fifthlevelhead, and
  603.                  define a corresponding \headE@
  604.                  (e.g., \def\headE@{\head5\the\fifthlevelhead}).
  605.  
  606.              (4) Modify the \level macro so that it includes \headE@.
  607.  
  608.              (5) Load \fifthlevelhead with some appropriate tokens.
  609.  
  610. NOTE  89: \setlevelno#1 has one parameter: the levelnumber to be established.
  611.           This can be up to 4 numbers, separated by periods. The level number
  612.           and the pointer to the head counters are initialized.
  613.  
  614.           .-1. is appended to the parameter to act as an end of parameter
  615.           signal.
  616.  
  617. NOTE  90: \sethead@#1. has as its parameter one of the numbers in the
  618.           parameter to \setlevelno.  The first number it receives is put into
  619.           the head counter for the first level. The second number goes into
  620.           the head counter for the second level, etc.  Processing is
  621.           completed when -1 is received as a parameter, or when 4 levels have
  622.           been done.
  623.  
  624. NOTE  91: \head#1 is called indirectly by \level via \headA@, or \headB@,
  625.           etc.  It oversees adjusting the \levelno according to the level of
  626.           the new heading. Its parameter is the level of the new
  627.           heading.
  628.  
  629.           If the new heading is on a level inferior to the current heading,
  630.           \uplevel@ is called, otherwise \headlevel is set to the level of
  631.           the new heading and that head counter for that level is incremented.
  632.  
  633.           \head@ is called to update \levelno.
  634.  
  635. NOTE  92: \uplevel@#1 does what is necessary to add a level that has a higher
  636.           number than the current level.  #1 is the level of the new heading.
  637.  
  638. NOTE  93: \head@ defines \levelno.
  639.  
  640. NOTE  94: These allocate token registers for each level description, and
  641.           define a corresponding \headA@ (or \headB@ etc.) that calls \head
  642.           with the appropriate parameter, and accesses the tokens for that
  643.           headlevel.
  644.  
  645. NOTE  95: \level#1#2 takes two parameters: #1 is the level of the heading,
  646.           and #2 becomes the definition of \title.  A case statement is
  647.           used to invoke the appropriate choice of \headA@, \headB@, etc.
  648.  
  649. <<CONTENTS FILE MACROS>>
  650.  
  651. NOTE  96: "\content@" can now be written with \write
  652.  
  653. NOTE  97: \ctswrite#1 writes its parameter into a file along with the current
  654.           page number.  If the file does not already exist, one is created.
  655.           When the file is read at a later time, @ will not be a character.
  656.           \_ is redefined so that it can be read from the contents file.
  657.           \content@ is defined with @ no longer a character so that it can be
  658.           read from the contents file.
  659.  
  660.  
  661. NOTE  98: \contents adds the table of contents if a contents file was
  662.           created.
  663.  
  664. <<FOOTNOTES AND INSERTIONS>>
  665.  
  666. NOTE  99: The \vfootnote#1 of PLAIN has been modified to accommodate
  667.           multi-column format by the insertion of \realhsize to restore the
  668.           original \hsize and by adding 1\baselineskip to remove any glue
  669.           from \baselineskip.
  670.  
  671. NOTE 100: \note generates footnotes with sequential numbers.
  672.  
  673. NOTE 101: \midinsert has been changed from the definition in PLAIN by
  674.          the insertion of \p@gefalse.
  675.  
  676. NOTE 102: \@ins has been changed from the definition in PLAIN by adding a
  677.           return to the normal \hsize and \vsize.
  678.  
  679. NOTE 103: The \endinsert of PLAIN has been modified. The "room left on page"
  680.           calculation has been expanded to handle multi-column format:  if
  681.           there is room, the columns are balanced and the insertion is
  682.           appended. The penalty (first item in the \insert) is set to -100 if
  683.           the insertion cannot fit on the current page, this keeps the page
  684.           from stretching if the insertion can't fit on the page.
  685.  
  686. <<COLUMN MACROS>>
  687.  
  688. NOTE 104: The column macros and output routines are interrelated. Every time
  689.           the number of columns changes, a false output routine is invoked.
  690.           This routine takes the current page (and splits it up if necessary)
  691.           and appends it to the contrib box. The \hsize is then reduced (or
  692.           restored) and the \vsize is multiplied (or restored). Then, to
  693.           every insert which was not void during the false output routine a
  694.           null insert is made. This restores the page goal (in case there are
  695.           no bona fide insertions, one insertion is always made, it is called
  696.           \hacker@). A new page total is then calculated from the height of
  697.           the contrib box. The two macros employed to do this work are
  698.           \balance@ and \newtotal@. Under no circumstances should the one be
  699.           used without the other.
  700.  
  701. NOTE 105: \balance invokes the false output routine which has the effect of
  702.           balancing the columns if in multi-column mode.  The page goal is
  703.           then updated by \newtotal@.
  704.  
  705. NOTE 106: \balance@ invokes the false output routine by setting \ifreal@ to
  706.           false, and forcing an eject.
  707.  
  708. NOTE 107: \newtotal@ restores the page total.
  709.  
  710. NOTE 108: \multicol@#1 is called by the \BEGIN command for multi-column
  711.           format.  It takes as its only parameter the number of columns
  712.           requested.  It provides error checking and ignores the command
  713.           if already in multi-column mode. If the command is legal, then
  714.           the current page is balanced, and the \hsize and \vsize are
  715.           adjusted. The insertion registers are modified, the page total
  716.           is adjusted, and stretch is added to \baselineskip.
  717.  
  718. <<OUTPUT ROUTINES>>
  719.  
  720. NOTE 109: The output routines are complex.  It is recommended that anyone
  721.           wanting to understand how they work examine the LOG file of a
  722.           short file with \tracingmacros=1 and \tracingcommands=2.
  723.  
  724.           There are two types of output routines:  \realoutput@ produces a
  725.           \shipout and \fakeoutput@ does not.
  726.  
  727.           The \toks registers associated with each insert are now reserved
  728.           (as were \dimen, \skip and \count). Any tokens in these registers
  729.           will be destroyed when the \output routine is active.
  730.  
  731. NOTE 110: \realoutput puts the current page into \out@.  If currently in one-
  732.           column mode, it goes in directly, otherwise the current page is
  733.           first split into columns.  Box 255 is then set to \contrb@ with
  734.           \old@ appended to it.  The glue for insertions, \hsize, \vsize,
  735.           \leftskip, and \rightskip are returned to normal for the \shipout.
  736.           After the \shipout, the flags and counters are updated for the
  737.           logical page macros.
  738.  
  739.  
  740. NOTE 111: \fakeoutput takes the current page, balances it if necessary, and
  741.           puts it into \out@.  \out@ is then appended to \contrb@.
  742.  
  743.           If any column must be shorter due to balancing, it ought to be the
  744.           rightmost. The \vsplit primitive, however, will usually make the
  745.           rightmost column longer. To avoid this problem, columns are split a
  746.           little more than 1/2 or 1/3 down. Experimentation shows that adding
  747.           1.16667 baselines to the total height for 2 columns, and adding 2
  748.           baselines to the total height for 3 columns affords the greatest
  749.           probability of an aesthetic break.
  750.  
  751. NOTE 112: The "@" is no longer a letter.
  752.